package com.lry.web.fiction.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("fiction_update")
public class FictionUpdate {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String fictionId;
    private String fictionUrl;
    private Integer chapterNum;
    private Date creationTime;
    private Integer fictionVariableId;
    @TableLogic
    private Integer deleted;

    public FictionUpdate(String fictionId, String fictionUrl, Integer chapterNum, Integer fictionVariableId){
        this.fictionId = fictionId;
        this.fictionUrl = fictionUrl;
        this.fictionVariableId = fictionVariableId;
        this.chapterNum = chapterNum;
        this.creationTime = new Date();
    }
}
